<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Usersremarks extends Model
{
    protected $table = 'users_remarks';
    protected $primaryKey = 'id';

    public static function addUsersRemarks($users_id,$title,$describe)
    {
        return self::insert([
            'users_id'   => $users_id,
            'title'      => $title,
            'describe'   => $describe,
            'created_at' => time(),
        ]);
    }

    public static function usersRemarksLists($users_id,$limit=20)
    {
        return self::where("users_id",$users_id)->orderBy("id","DESC")->paginate($limit);
    }
}
